package outOfMemoryError;

import lombok.extern.slf4j.Slf4j;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;

/**
 * @author ganbo
 * @date 2022/10/31 8:01
 */

@Slf4j
public class T1 {

    static ThreadLocal threadLocal = new ThreadLocal();

    private static final int _10MB = 2011 * 1024 * 1024;

    public static void main(String[] args) throws InterruptedException {

        threadLocal.set("新生代发送普通gc，弱引用会被回收吗？");
        System.out.println("111==============>" + threadLocal.get());
        try {
            byte[] arr = new byte[_10MB];
        } catch (Error e) {
            log.info("=============" + e);
        }
        System.out.println("2222222222======>" + threadLocal.get());
    }


}

class User {

}


